import re

data=""
with open("data_example.py",'r',encoding='utf-8') as f:
    for l in f.readlines():
        model=re.findall(r"(.+?)=.*",l)[0]
        field_pack:str=re.findall(r"\((.+?)\)",l)[0]
        field_pack:list=field_pack.split(',')
        field_pack:list=[
            f"\"{i.split('=')[0].lower()}\" : {i.split('=')[1].lower()}" for i in field_pack
        ]
        data+='{ "model": "'+ model+'.'+model +'", "pk": 1, "fields": { '+ ','.join(field_pack) +' } },\n'
print(data,file=open("data.json",'w',encoding='utf-8'))